﻿<UserControl x:Class="PJ.Presentation.Partner.CustomerListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:model="clr-namespace:PJ.Presentation.Partner;assembly=PJ.Presentation.PartnerModel"            
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit">

    <UserControl.Resources>
        <Style x:Key="TitleBorder" TargetType="Border">
            <Setter Property="CornerRadius" Value="10"/>
            <Setter Property="Background" Value="#FF77B6EB"/>
            <Setter Property="Margin" Value="5,2,5,2"/>
        </Style>

        <Style x:Key="TitleText" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Franklin Gothic"/>
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="Background" Value="#FF77B6EB"/>
            <Setter Property="Foreground" Value="#FFFFFFFF"/>
        </Style>
</UserControl.Resources>
    <!--
    <UserControl.DataContext>
        <model:CustomerModel Address="3, rue des Ecoles 67870 Bischoffsheim France" GlobalID="2822-05210-452" ID="PIQJER" Name="Piquot Jérôme" Phone="+33 3 88 48 71 31"/>
    </UserControl.DataContext>
    -->
    <Grid >
        <dg:DataGrid ItemsSource="{Binding Path=Items}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                         AutoGenerateColumns="False" SelectionChanged="ListView_SelectionChanged_1" 
                     Foreground="#FF77B6EB" FontSize="10" MinColumnWidth="50" MinHeight="200" GridLinesVisibility="None" SelectionMode="Single" HorizontalScrollBarVisibility="Disabled" IsReadOnly="True">
            <dg:DataGrid.Columns>
                <dg:DataGridTextColumn
                            Header="Nom" 
                            Width="Auto"                            
                            Binding="{Binding Path=Name}" IsReadOnly="True" SortDirection="Ascending" />
                <dg:DataGridTextColumn
                            Header="Adresse" 
                            Width="Auto"                            
                            Binding="{Binding Path=Address}" IsReadOnly="True"
                        />
                <dg:DataGridTextColumn
                            Header="Téléphone" 
                            Width="Auto"                            
                            Binding="{Binding Path=Phone}" IsReadOnly="True"
                        />
                <dg:DataGridTextColumn 
                            Header="Id" 
                            Width="75" 
                            Binding="{Binding Path=Id}" IsReadOnly="true"                              
                        />
            </dg:DataGrid.Columns>
        </dg:DataGrid>
    </Grid>
</UserControl>
